package pl.edu.pk.mech.kkbus.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import pl.edu.pk.mech.kkbus.model.Bus;
import pl.edu.pk.mech.kkbus.repository.BussesDAO;
import static pl.edu.pk.mech.kkbus.staticstrings.NameEntity.NAME_ENTITY_BUSSES;
@Service
public class BussesService {

    @Autowired
    BussesDAO bussesDAO;
    
    public boolean createOrUpdateBusses(Bus busses) {
    	return bussesDAO.createOrUpdate(busses, NAME_ENTITY_BUSSES, bussesDAO);
    }
    
    public List<Bus> getAllBusses() {
        return bussesDAO.getAllBusses();
    }   
    
    public Bus getBus(long key) {
        return bussesDAO.getBus(key);
    }
  
}
